package edu.ustb.spring.test;

import java.lang.reflect.Method;

import org.apache.log4j.Logger;
import org.springframework.aop.MethodBeforeAdvice;

/**
 * 前置通知
 * @author lijia
 *
 */
public class LogAdvice implements MethodBeforeAdvice {

	private Logger logger = Logger.getLogger(LogAdvice.class);
	
	@Override
	public void before(Method method, Object[] args, Object target)
			throws Throwable {
		String className = target.getClass().getName();
		String methodName = method.getName();
		String message = "前置通知："+className+" 类的 "+methodName +" 方法开始执行";
		logger.info(message);
	}

}
